#ifndef MATRIXOPERATIONS_HPP
#define MATRIXOPERATIONS_HPP

namespace TermStructure
{
    //! Matrix multiplication
	template <typename TLeftMatrix, typename TRightMatrix, typename TResultMatrix>
	void Multiply(const TLeftMatrix &l, const TRightMatrix &r, TResultMatrix &result)
	{

	}
    //! matrix plus
	template <typename TLeftMatrix, typename TRightMatrix, typename TResultMatrix>
	void Plus(const TLeftMatrix &l, const TRightMatrix &r, TResultMatrix &result)
	{
		for(long i = 0; i < l.GetLength(0) && i < r.GetLength(0); i++)
		{
			for(long j = 0; j < l.GetLength(1) && j < r.GetLength(1); j++)
			{
				result(i,j) = l(i,j) + r(i,j);
			}
		}
	}
    //! matrix minus l - r
	template <typename TLeftMatrix, typename TRightMatrix, typename TResultMatrix>
	void Minus(const TLeftMatrix &l, const TRightMatrix &r, TResultMatrix &result)
	{
		for(long i = 0; i < l.GetLength(0) && i < r.GetLength(0); i++)
		{
			for(long j = 0; j < l.GetLength(1) && j < r.GetLength(1); j++)
			{
				result(i,j) = l(i,j) - r(i,j);
			}
		}
	}
}

#endif
